import "../css/ColSelector-nMyoyU5e.css";
import { defineComponent as E, toRefs as I, ref as f, onMounted as N, openBlock as B, createElementBlock as K, createTextVNode as c, createVNode as l, unref as s, withCtx as a, createElementVNode as i, toDisplayString as h } from "vue";
import { d as b, b as T, e as U } from "./index.Bbfhrq76.js";
import { g as w, b as k, r as F, bI as J, c as M, f as O } from "./vendor.CF2kwqqq.js";
import { _ as P } from "./_plugin-vue_export-helper.CHgC5LLL.js";
const R = { class: "nifi-column" }, j = {
  class: "allocation_content",
  "h-360": ""
}, q = { class: "transfer_options" }, z = { class: "multi-ellipsis" }, A = { class: "allocation_footer" }, G = /* @__PURE__ */ E({
  __name: "index",
  props: {
    formdata: {},
    propInput: {},
    propOutput: {},
    inputV: {}
  },
  setup(n) {
    const v = n, { formdata: d, inputV: C, propInput: g, propOutput: _ } = I(v), u = f(C.value), o = f(!1), p = () => {
      o.value = !0;
    }, S = {
      key: "name",
      label: "name"
    }, m = f([]), y = f([]), V = () => {
      o.value = !1;
    }, D = () => {
      x(), V();
    }, x = () => {
      let r = u.value.filter(
        (e) => m.value.includes(e.name)
      );
      O(d.value, g.value, b(u.value)), O(d.value, _.value, b(r));
    };
    return N(() => {
      let r = w(d.value, _.value);
      if (r) {
        let e = JSON.parse(r);
        m.value = e.map((t) => t.name);
      } else
        y.value = u.value.map(
          (e) => e.name
        );
      x();
    }), (r, e) => (B(), K("div", R, [
      c(" 选择输出列 "),
      l(s(k), {
        type: "primary",
        onClick: p,
        style: { "margin-left": "12px" }
      }, {
        default: a(() => [
          c(" 选择输出列 ")
        ]),
        _: 1
      }),
      l(s(F), {
        modelValue: o.value,
        "onUpdate:modelValue": e[1] || (e[1] = (t) => o.value = t),
        title: "选择输出列",
        "destroy-on-close": "",
        "w-960": "",
        "h-520": "",
        "before-close": V
      }, {
        default: a(() => [
          i("div", j, [
            l(s(J), {
              filterable: "",
              "filter-placeholder": "请输入",
              titles: ["已选字段", "已选字段"],
              props: S,
              modelValue: m.value,
              "onUpdate:modelValue": e[0] || (e[0] = (t) => m.value = t),
              data: u.value,
              "left-default-checked": y.value
            }, {
              default: a(({ option: t }) => [
                i("div", q, [
                  l(s(M), null, {
                    content: a(() => [
                      c(h(t.name), 1)
                    ]),
                    default: a(() => [
                      i("div", z, h(t.name), 1)
                    ]),
                    _: 2
                  }, 1024),
                  i("span", null, h(t.doc), 1)
                ])
              ]),
              _: 1
            }, 8, ["modelValue", "data", "left-default-checked"])
          ]),
          i("div", A, [
            l(s(k), { onClick: V }, {
              default: a(() => [
                c("取消")
              ]),
              _: 1
            }),
            l(s(k), {
              type: "primary",
              onClick: D
            }, {
              default: a(() => [
                c("保存")
              ]),
              _: 1
            })
          ])
        ]),
        _: 1
      }, 8, ["modelValue"])
    ]));
  }
}), H = /* @__PURE__ */ P(G, [["__scopeId", "data-v-6ca9c540"]]), Z = () => {
  let n = [];
  const v = ["output-param", "output字段（自动填入）"];
  return { name: ["org.apache.nifi.column.processors.ColSelector_2_0"], excludeKeys: ["col-selector-input", "output-param"], selfFormColumn: [
    {
      tag: H,
      propInput: "config.properties['col-selector-input']",
      propOutput: "config.properties['output-param']",
      ":formdata": "formData",
      setup() {
        return { inputV: n };
      },
      ":inputV": "inputV"
    }
  ], hooksOpen: (o, p) => {
    n = [], n = T(o, p, v);
  }, hooksSubmit: (o, p) => {
    U(o, p);
  } };
};
export {
  Z as default
};
